<template>
	<u-popup
		v-model="isShow"
		mode="center"
		:borderRadius="14"
		:maskCloseAble="false"
		:closeable="true"
	>
		<view 
			style="display: flex;
			flex-direction: column;
			align-items: center;
			height: 600rpx;
			width: 600rpx;
			justify-content: space-around;"
		>
		
			<view style="display: flex;justify-content: center;
			width: 400rpx;
			height: 200rpx;">
				<u-icon name="error-circle-fill" 
				:color="isFirst?'#2979ff':'#ff7e1c'" 
				size="150"></u-icon>
			</view>
			<view style="text-align: center;width: 500rpx;">
				{{text}}
			</view>
			<view style="display: flex;flex-direction: column;justify-content: center;">
				<u-button
					 @click="onOk"
					:type="isFirst?'primary':'warning'" 
					size="medium"
				>{{isFirst?'立即上传':'重新认证'}}</u-button>
				<view style="height: 20rpx;">
					
				</view>
				<u-button 
					@click='onCancel'
					v-if="!isFirst" 
					size="medium"
				>
					暂不认证
				</u-button>
			</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
	
		props:{
			show: {
				type: Boolean,
				default: false
			},
			text: {
				type: String,
				default:''
			},
			isFirst:{
				type:Boolean,
				default:true
			}
		},
		
		watch: {
			show: {
				handler(newValue, oldValue) {
					this.isShow = newValue
				},
				immediate: true,
				deep: true
			}
		},
		
		data() {
			return {
				isShow: false
			}
		},
		
		methods: {
			/**
			 * @description 取消按钮
			 */
			onCancel() {
				this.$emit('close')
			},
			
			/**
			 * @description 确定按钮
			 */
			onOk(){
				this.$emit('ok')
			}
		}
	}
</script>

<style>

</style>
